import pytest,time

from selenium import webdriver

from unit_729.Page.Page2 import Page2
from unit_729.db.db import db
class MyTestCase():
    @pytest.fixture(scope='function')
    def driver(self):
        self.msq = db(username='root',password='yidong666',host='10.59.9.12',database='a3mall')
        self.driver = webdriver.Chrome()
        self.driver.maximize_window()
    def tearDown(self):
        time.sleep(10)
        self.driver.quit()
    def test_A3mall_01(self):
        po = Page2(self.driver)
        po.luoji_01_login()
        dy1=po.duanyan()
        self.assertEqual(str(dy1),'您好, 15821860061 欢迎回来！')
        yq1=self.msq.select(" select amount from mall_users where username = '15821860061'")
        print(yq1[0][0])


if __name__ == '__main__':
    pytest.main(["-s","MyTestCase"])
